home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / U-Z / ViewIt™ 2.2 Shareware / Projects / THINK C 6.0 Demos / TutorialLC.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  1.4 KB  |  52 lines  |  [TEXT/KAHL]

  1. /* Tutorial LC Demonstration Program */
  2. /* ©FaceWare 1993.  All Rights Reserved. */
  3.  
  4. #include <string.h>
  5. #include "FaceStorLC.h"
  6. extern struct FaceRec fRec;
  7.  
  8. short theFlag,theListItem,theMenuItem;
  9. char theString[32];
  10.  
  11. void main()
  12. {
  13.     strcpy(fRec.uName, "Tutorial.Rsrc");
  14.     FaceIt(0L,DoInit,0L,0L,0L,0L);
  15.     theFlag = 0;
  16.     theListItem = 3;
  17.     theMenuItem = 2;
  18.     strcpy(theString,"Hello");
  19.     for (;;) {
  20.         FaceIt(0L,DoLoop,0L,0L,0L,0L);
  21.         if ((fRec.uMenuID == 105)&&(fRec.uMenuItem == 1))
  22.             {
  23.             FaceIt(0L,NewWnd,1010L,0L,0L,0L);
  24.             FaceIt(0L,GetCtl,1010L,0L,1L,3L);
  25.             FaceIt(0L,LnkCtl,(long)fRec.cControl,(long)&theFlag,2L,0L);
  26.             FaceIt(0L,GetCtl,1010L,0L,1L,4L);
  27.             FaceIt(0L,LnkCtl,(long)fRec.cControl,(long)theString,-31L,0L);
  28.             FaceIt(0L,GetCtl,1010L,0L,1L,5L);
  29.             FaceIt(0L,LnkCtl,(long)fRec.cControl,(long)&theListItem,2L,0L);
  30.             FaceIt(0L,GetCtl,1010L,0L,1L,6L);
  31.             FaceIt(0L,LnkCtl,(long)fRec.cControl,(long)&theMenuItem,2L,0L);
  32.             FaceIt(0L,SetVal,1010L,0L,0L,0L);
  33.             for (;;) {
  34.                 FaceIt(0L,MdlWnd,1010L,0L,0L,0L);
  35.                 if (fRec.uMenuID == 1010) {
  36.                     if (fRec.wcHit == -1)
  37.                         break;
  38.                     else if (fRec.wcHit == 1) {
  39.                         FaceIt(0L,GetVal,1010L,0L,0L,0L);
  40.                         break;
  41.                         }
  42.                     else if (fRec.wcHit == 2) {
  43.                         FaceIt(0L,GetCtl,1010L,0L,1L,8L);
  44.                         strcpy(fRec.uString,"Run button was hit.");
  45.                         FaceIt(fRec.cControl,1565L,2L,0L,0L,0L);
  46.                         }
  47.                     }
  48.                 }
  49.             FaceIt(0L,EndWnd,1010L,0L,0L,0L);
  50.             }
  51.         }
  52. }